/*****************************************************
** Author: 
** Date: 2017-10-23
** Copyright(c) All Rights Reserved.
*****************************************************/

#ifndef __DNA_SYS_TOOLS_H_
#define __DNA_SYS_TOOLS_H_

#ifdef __cplusplus
extern "C"{
#endif

/***** INCLUDES *************************************/
#include "dna_sys_shell.h"

/***** TYPEDEFS *************************************/
typedef void * syscom_handle_t;

/***** DEFINES **************************************/

/***** CONSTANTS ************************************/

/***** VARIABLES ************************************/

/***** EXTERNAL VARIABLES ***************************/

/***** EXTERNAL FUNCTIONS ***************************/

/***** PROTOTYPES ***********************************/
int  dna_shell_init(void);
int  dna_shell_register(char *cmd, char *desc, int (*func)(int, int, char**));
/*
 *  @brief: !!! note out buffer max size is 1KB
 *          so the print string sould not large than it
 */
void dna_shell_print(int fd, const char* str, ...);
/*
 *  @brief: !!! note out buffer max size is 1KB
 *          so the dump memory string sould not large than it
 */
void dna_shell_print_hex(int fd, char *desc, unsigned char *buff, int len);


syscom_handle_t dna_syscom_init(int stack_size);
int dna_syscom_register(syscom_handle_t syscom, void (*handler)(unsigned char *pbuf, unsigned int len));
int dna_syscom_send(syscom_handle_t syscom, unsigned short syscom_id, unsigned char *pbuf, int len);
int dna_syscom_deinit(syscom_handle_t syscom);


#ifdef __cplusplus
}
#endif

#endif /* __DNA_SYS_TOOLS_H_ */

